import Vue from "vue";
import VueRouter from "vue-router";
import allRoutes from "./generateRoute";
import staticRoutes from "./staticRoutes";
// import dynamicRoutes from "./dynamicRoutes";
Vue.use(VueRouter);

const routes = [
  // {
  //   path: "/",
  //   component: () => import("@/pages/Home"),
  //   children: [
  //     {
  //       path: "welcome",
  //       component: () => import("@/pages/Home/Welcome")
  //     }
  //   ]
  // },
  // {
  //   path: "/login",
  //   component: () => import("@/pages/Login")
  // }
  // ...allRoutes
  //...要和另外一个文件的[]一起用才不会报错
  ...staticRoutes
];

const router = new VueRouter({
  routes
});

export default router;
